package com.example.linktop.broadcastbestpractice;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class LoginActivity extends BaseActivity {

    private EditText editTxtName, editTextPwd;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        editTxtName = (EditText)findViewById(R.id.editName);
        editTextPwd = (EditText)findViewById(R.id.editPwd);


    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }


    //按钮点击方法
    public void loginFuntion(View v) {
        String account = editTxtName.getText().toString().trim();
        String pwd = editTextPwd.getText().toString().trim();

        if (account.equals("admin") && pwd.equals("1234")) {
            //发通知跳转
            Intent intent = new Intent(LoginActivity.this, MainActivity.class);
            startActivity(intent);
            finish();

        } else  {

            Toast.makeText(LoginActivity.this, "登录失败", Toast.LENGTH_SHORT).show();
        }



    }


}
